package com.yan.lesson01;

import java.net.InetSocketAddress;

public class TestInetSocketAddress {

    public static void main(String[] args) {

        InetSocketAddress address = new InetSocketAddress("127.0.0.1", 8080);System.out.println(address);
        System.out.println(address.getAddress());
        System.out.println(address.getHostName());
        System.out.println(address.getPort());// 获取端口号
    }
}
